import 'package:easy_refresh/easy_refresh.dart';
import 'package:get/get.dart';

import '../../http/api.dart';

class MsgCenterLogic extends GetxController {

  var page = 1;
  var limit = 20;
  EasyRefreshController? refreshController;

  var listData=<dynamic>[].obs;

  loadData() async {

    Future.delayed(const Duration(milliseconds: 220),(){
      listData.add("");
      listData.add("");
      if(page==1){
        refreshController?.finishRefresh();
        page++;
      }else{
        refreshController?.finishLoad();
      }
    });
  }

  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();
    refreshController = EasyRefreshController(
      controlFinishLoad: true,
      controlFinishRefresh: true,
    );
  }

  @override
  void onReady() {
    // TODO: implement onReady
    super.onReady();
    page = 1;
    loadData();
  }

  @override
  void onClose() {
    // TODO: implement onClose
    super.onClose();
  }
}
